#include "Base.h"
#include "Derive1.h"
#include "Derive2.h"
#include <iostream>
using namespace std;
int main(int argc, char * argv[])
{
  Base * bb = new Base;
  Base * bd1 = new Derive1;
  Base * bd2 = new Derive2;
  Derive1 * d11 = new Derive1;
  Derive1 * d12 = new Derive2;
  Derive2 * d22 = new Derive2;

  cout << "  A" << endl;
  bb -> f1();
  bb -> f2();
  cout << "  B" << endl;
  bd1 -> f1();
  bd1 -> f2();
  cout << "  C" << endl;
  bd2 -> f1();
  bd2 -> f2();
  cout << "  D" << endl;
  d11 -> f1();
  d11 -> f2();
  d11 -> f3();
  cout << "  E" << endl;
  d12 -> f1();
  d12 -> f2();
  d12 -> f3();
  cout << "  F" << endl;
  d22 -> f1();
  d22 -> f2();
  d22 -> f3();
  d22 -> f4();

  delete bb;
  delete bd1;
  delete bd2;
  delete d11;
  delete d12;
  delete d22;

  return 0;
}
